#pragma once
#ifndef PELIB_H
#define PELIB_H

#define LDWORD(x) ((DWORD)(((ULONGLONG)((x))&0x00000000ffffffff)))

#define HDWORD(x) ((DWORD)(((ULONGLONG)((x))>>32)&0x00000000ffffffff))

#ifndef DLLLIB
#define DLL_FUNTCION __declspec(dllimport)
#else
#define DLL_FUNTCION __declspec(dllexport)
#endif
#include<Windows.h>
#include <string>
#include <vector>
struct diff
{
	DWORD offset;
	LPVOID DataFile1;
	LPVOID DataFile2;
};
bool DLL_FUNTCION validateDllName(const char* input, int size);
std::string DLL_FUNTCION dumpPe(DWORD pid, const char* module, const char* output, DWORD oep);
void DLL_FUNTCION getSectionList(const char* filename, std::vector<IMAGE_SECTION_HEADER>& SectionInfo);
void DLL_FUNTCION getTHUNKDATA(const char* filename, std::vector<LPVOID>& functionlist, DWORD thunk);
void DLL_FUNTCION SetSectionHeader(const char* filename, int index, IMAGE_SECTION_HEADER& SectionInfo);
void DLL_FUNTCION fix_int(const char* output, const char* dllname, std::vector<std::string> functions, DWORD THUNK);
void DLL_FUNTCION getPossibleReloc(const char* file1, const char* file2, std::vector<diff>&);
void DLL_FUNTCION create_reloc(const char* file1, std::vector<DWORD>& relocs); 
void DLL_FUNTCION addASection(const char* orgin_file, const char* out_file, const char* section_name, DWORD section_size, DWORD Characteristics);
#endif